﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FAQPro.Filters
{
    public class AuthorizationFilterAttribute : TypeFilterAttribute
    {
        public AuthorizationFilterAttribute() : base(typeof(AuthorizationFilterImpl))
        {
        }

        public class AuthorizationFilterImpl : IActionFilter
        {
            public void OnActionExecuted(ActionExecutedContext context)
            {
                //throw new NotImplementedException();
            }

            public void OnActionExecuting(ActionExecutingContext context)
            {
                //throw new NotImplementedException();
                context.Result = new ContentResult()
                {
                    Content = "Resource unavailable - header should not be set"
                };
            }
        }
    }
}
